<?PHP
// Config de Moodle, chemin à modifier en fonction du chemin d'installation de ce module
include('../../config.php');
$SECURITE="OK";
include('../includes/config/config.php');
include('../includes/includes.php');

$cours_id=$_POST['course'];
$visible=$_POST['visible'];

$visibilite[0]="Caché";
$visibilite[1]="Visible";
  
if ($visible=="1"){$contraire=0;}else{$contraire=1;}
  
moodle_change_cours_visible($cours_id,$visible);

echo $visibilite[$visible]." > <a href='#' onclick='";
    ?>
    $("#visibilite").load("cours/cours_modif_visibilite.php" , {course:<?PHP echo $cours_id;?>,visible:<?PHP echo $contraire;?>});
    window.location.reload();
    <?PHP echo "'>Rendre ".$visibilite[$contraire]."</a>";
   
?>
